package com.example.attendancesystem_1_8.Leader;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;

import com.example.attendancesystem_1_8.DakaFragment;
import com.example.attendancesystem_1_8.R;
import com.example.attendancesystem_1_8.SetTimeFragment;

import java.util.ArrayList;
import java.util.List;

public class Add_DaKa extends AppCompatActivity {

    private ImageButton ibtn_cancel, ibtn_addthis;
    private EditText et_goWork1, et_goWork2, et_leaveWork1, et_leaveWork2, et_wuCha, et_wucha2;
    private CheckBox cb_w1, cb_w2, cb_w3, cb_w4, cb_w5, cb_w6, cb_w7;

    private ArrayList<String> outData = new ArrayList<String>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add__daka);

        InitKJ();
        ibtn_cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        ibtn_addthis.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view)
            {
                //Intent i = new Intent(Add_DaKa.this, SetTimeFragment.class);
                //String[] outData = {et_goWork1.getText().toString(), et_goWork2.getText().toString()};
                /*
                outData.add(et_goWork1.getText().toString());
                outData.add(et_goWork2.getText().toString());
                outData.add(et_wuCha.getText().toString());
                if(cb_w1.isChecked())
                {
                    outData.add("1");
                }
                if(cb_w2.isChecked())
                {
                    outData.add("2");
                }
                if(cb_w3.isChecked())
                {
                    outData.add("3");
                }
                if(cb_w4.isChecked())
                {
                    outData.add("4");
                }
                if(cb_w5.isChecked())
                {
                    outData.add("5");
                }
                if(cb_w6.isChecked())
                {
                    outData.add("6");
                }
                if(cb_w7.isChecked())
                {
                    outData.add("7");
                }
                i.putExtra("dakaTime", outData);

                 */
                finish();
                //startActivity(i);
            }
        });

    }

    private void InitKJ()
    {
        ibtn_cancel = findViewById(R.id.ibtn_cancel);
        ibtn_addthis = findViewById(R.id.ibtn_addthis);
        et_goWork1 = findViewById(R.id.et_goWork1);
        et_goWork2 = findViewById(R.id.et_goWork2);
        et_leaveWork1 = findViewById(R.id.et_leaveWork1);
        et_leaveWork2 = findViewById(R.id.et_leaveWork2);
        et_wuCha = findViewById(R.id.et_wuCha);
        et_wucha2 = findViewById(R.id.et_wucha2);
        cb_w1 = findViewById(R.id.cb_w1);
        cb_w2 = findViewById(R.id.cb_w2);
        cb_w3 = findViewById(R.id.cb_w3);
        cb_w4 = findViewById(R.id.cb_w4);
        cb_w5 = findViewById(R.id.cb_w5);
        cb_w6 = findViewById(R.id.cb_w6);
        cb_w7 = findViewById(R.id.cb_w7);
    }

}